var mongoose=require('mongoose');
const Schema=mongoose.Schema;
var mongoosePaginate=require('mongoose-paginate');
var ObjectId=Schema.ObjectId;
//定义一个普通数据模型
var UploadSchema=new mongoose.Schema({
	fieldname:String,
	originalname:String,
	encoding:String,
	mimetype:String,
	destination:String,
	filename:String,
	path:String,
	size:String,
	date:{type:Date,default:Date.now},
	newsId:ObjectId
});
//将数据模型应用分页插件
UploadSchema.plugin(mongoosePaginate);//schema数据模型里使用了分页插件


module.exports=mongoose.model('Upload',UploadSchema,'upload');